package hr.entity.enums;

public enum ProbationStatus {
    CONVERT(0, "转正"),
    DELAY(1, "延期"),
    NOT_PASSED(2, "不通过");

    private final int code;
    private final String label;

    ProbationStatus(int code, String label) {
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public String getLabel() {
        return label;
    }

    // 根据状态值获取对应的字符串表示
    public static String getLabelByCode(int code) {
        for (ProbationStatus status : ProbationStatus.values()) {
            if (status.code == code) {
                return status.label;
            }
        }
        return "未知状态";
    }
}
